<%@ taglib prefix="height" uri="/struts-tags" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
</head>
<body >
<table class="easyui-datagrid" title="Basic DataGrid"
       data-options="singleSelect:true,collapsible:true,url:'${pageContext.request.contextPath}/json/stafftest.json'">
    <thead>
    <tr>
        <th data-options="field:'id',width:80">Item ID</th>
        <th data-options="field:'name',width:100">name</th>
        <th data-options="field:'haspda',width:80,align:'right'">List Price</th>

    </tr>
    </thead>
    <script>
        $(function () {

            $("#grid").datagrid({
                url:'${pageContext.request.contextPath}/json/stafftest.json',
                columns:[[
                    {field:'id',title:'编号',width:100,checkbox:true},
                    {field:'name',title:'姓名',width:100},
                    {field:'age',title:'年龄',width:100}
                ]],
                toolbar:[
                    {
                        iconCls: 'icon-edit',
                        text:'Edit',
                        handler: function(){
                            alert('编辑按钮')}
                    },
                    {
                        text:'删除',
                        handler: function(){
                            alert('编辑按钮')}
                    }
                ]
            });

        });
    </script>
    <table id="grid"  class="easyui-datagrid"></table>


</table>



</body>
</html>
